package com.itheima06;

import java.util.Collections;
import java.util.Set;
import java.util.TreeSet;

/**
 * @author Xiao
 * @date 2021/7/25
 */
public class SetDemo01 {
    /**
     * 练习：
     *      Set集合存储字符串并遍历
     */
    public static void main(String[] args) {
        Set<String> set = new TreeSet<>();
        Collections.addAll(set, "cc","aa", "bb", "cc");
//        System.out.println(s);
        for (String s : set) {
            System.out.println(s);
        }
    }
}
